#include "PrecompiledHeader_Engineer.h"
#include "Stone.h"

/*--------------------------------------------------------------------------*/

Stone::Stone(Quad* parent, const glm::vec3& position) :
	IQuadObject(parent, position)
{
	this->m_stoneRenderable.SetParent(parent);
	this->m_stoneRenderable.SetPosition(position);

	this->m_stoneRenderable.SetHighQualityVao(OpenGL::GetSmallSphereVao());
	this->m_stoneRenderable.SetLowQualityVao(OpenGL::GetSmallSphereVao());
	this->m_stoneRenderable.SetOcclusionTestEnabled(false);
	this->m_stoneRenderable.SetScale(rand() % 10 / 10.0f + 1.0f);
	this->m_stoneRenderable.SetRadius(this->m_stoneRenderable.GetScale().x);
	this->m_stoneRenderable.SetRotation(glm::vec3(rand() % 1000, rand() % 1000, rand() % 1000));

	this->m_stoneRenderable.ClearTasks();
	this->m_stoneRenderable.AddRenderTask(CContext::getInstance()->GetContext("d3d"),
	                                      CMaterial::getInstance()->GetMaterial("mat_3d_terrain"),
	                                      CCamera::getInstance()->GetCamera("cam3d"),
	                                      10,
	                                      vl::Render::ColorAndDepth);
}

/*--------------------------------------------------------------------------*/

Stone::~Stone()
{
}

/*--------------------------------------------------------------------------*/

void Stone::Update()
{

}

/*--------------------------------------------------------------------------*/